import Vue from "vue";
import "normalize.css/normalize.css"; // A modern alternative to CSS resets
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import i18n from "./components/i18n/i18n";
//import locale from 'element-ui/lib/locale/lang/zh-CN'
import App from "./App";
import router from "./router";
import store from "./store";
import "@/icons"; // icon
import "@/permission"; // 权限
import {
  default as api
} from "./utils/api";
import {
  hasPermission
} from "./utils/hasPermission";
import {
  parseTime
} from "./utils/index";
// import vcrontab from "vcrontab";
import Validator from "vue-validator";
import common from './utils/common';
Vue.use(Validator);
Vue.use(common);
// Vue.use(vcrontab);
//全局引入
// Vue.use(ElementUI, {locale})
Vue.use(ElementUI);
Vue.prototype.api = api;
Vue.prototype.parseTime = parseTime;
Vue.prototype.$EventBus = new Vue();
//全局的常量
Vue.prototype.hasPerm = hasPermission;
//生产环境时自动设置为 false 以阻止 vue 在启动时生成生产提示。
Vue.config.productionTip = process.env.NODE_ENV != "production";

new Vue({
  el: "#app",
  router,
  i18n,
  store,
  template: "<App/>",
  components: {
    App
  }
});
